var app = getApp()
Page({
  data:{
    person:{},
    background: ['green', 'red', 'yellow'],
    indicatorDots: false,
    vertical: false,
    autoplay: false,
    interval: 3000,
    duration: 1000,
    topOpacity: 1,
    topAnimation: {},
  },
  onLoad:function(options){
    // 生命周期函数--监听页面加载
    let person = app.globalData.detailPerson;
    this.setData({
      person:person
    });
  },

  imageTap:function(){
    let hide = this.data.topOpacity == 1

    var animation = wx.createAnimation({  
      duration: 500,  
    })

    if(hide){

      animation.opacity(0).step()
      this.setData({  
        topAnimation: animation.export(),
        topOpacity:0
      })

    }else{

      animation.opacity(1).step()
      this.setData({  
      topAnimation: animation.export(),
      topOpacity:1
    
    })

    }


  }
  
})